﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace ERPStore.Events
{
	[DataContract]
	public class TrackerEvent
	{
		public TrackerEvent()
		{
			ExtendedParameters = new List<ERPStore.Models.WebParameter>();
			CreationDate = DateTime.Now;
		}

		[DataMember]
		public string ControllerName { get; set; }
		[DataMember]
		public string ActionName { get; set; }
		[DataMember]
		public string UserHostAddress { get; set; }
		[DataMember]
		public string UserAgent { get; set; }
		[DataMember]
		public string VisitorId { get; set; }
		[DataMember]
		public object Model { get; set; }
		[DataMember]
		public string RawUrl { get; set; }
		[DataMember]
		public string Referer { get; set; }
		[DataMember]
		public string LocalPath { get; set; }
		[DataMember]
		public string Language { get; set; }
		[DataMember]
		public int ResponseStatusCode { get; set; }
		[DataMember]
		public string OriginalUrl { get; set; }
		[DataMember]
		public IList<ERPStore.Models.WebParameter> ExtendedParameters { get; set; }
		[DataMember]
		public DateTime CreationDate { get; set; }
		[DataMember]
		public string ViewName { get; set; }
		[DataMember]
		public int? UserId { get; set; }

		public string ControllerActionName
		{
			get
			{
				return string.Format("{0}/{1}", ControllerName, ActionName).ToLower();
			}
		}
	}
}
